< previous page page_289 next page >

Page 289
Caution
If you want to restrict the ListView display option to only Report, remove any toolbar buttons or menu options that would allow users to change the display.

The other routine called from the NodeClick event displays the data-entry form for the selected name. This requires a small change to the frmAddressEntry to get the use the SQL statement that's created and display the correct record. Listing 10.12 shows this code.
LISTING 10.12. ADDRDAO5.TXTMODIFYING THEForm_LoadCODE IN THEfrmAddressEntryFORM.

8694cbadb9b1ef7075903f6f95fc1db2.gif
1: Private Sub Form_Load()
2:     If sqlEntry =  Then
3:         sqlEntry = select * from [Address Entry]
4:     End If
5:     datPrimaryRS.RecordSource = sqlEntry
6:     datPrimaryRS.Refresh
7:      If datPrimaryRS.Recordset.RecordCount = 0 Then _
           datPrimaryRS.Recordset.AddNew
8: End Sub

Now, run the application again and try out the new functions you just added.
Enhancing the Entry Form
In this section, you add a combo box to allow users to select a state to add to an entry. The state abbreviations are retrieved from a reference table in the database and displayed in the drop-down list. To make the process dynamic, users also can enter state abbreviations as needed and have them added to the database. To start the process, add a data-bound combo box to the data-entry form in place of the original state text box (see Figure 10.15).

 
< previous page page_289 next page >

If you like this book, buy it!